package com.cn.serverline.lineicp.produce.mapper;

import com.cn.serverline.lineicp.produce.entity.vo.IpVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

/**
 * @Author 王烁烁
 * @Date 2024/8/6
 */
@Mapper
public interface LoginIpMapper {

        @Select("SELECT \n" +
                "    TE_RESOURCE.RESOURCE_NAME AS equipmentName,\n" +
                "    TE_RESOURCE.RESOURCE_NUMBER AS equipNum,\n" +
                "    TE_RESOURCE.RESOURCE_ALL_IN_ONE_IP AS ipAddress,\n" +
                "    temStation.MODEL_NAME AS stationName,\n" +
                "    temStation.ENCODING AS cellEncoding,\n" +
                "    temUnit.MODEL_NAME AS unitName,\n" +
                "    temRegion.MODEL_NAME AS regionName,\n" +
                "    temRegion.ID AS id\n" +
                "FROM \n" +
                "    TE_RESOURCE\n" +
                "INNER JOIN \n" +
                "    TE_PRO_DEVICE_TOOL_USER ON TE_RESOURCE.ID = TE_PRO_DEVICE_TOOL_USER.RESOURCE_ID\n" +
                "INNER JOIN \n" +
                "    TE_PRO_MODEL temStation ON temStation.ID = TE_PRO_DEVICE_TOOL_USER.PID\n" +
                "INNER JOIN \n" +
                "    TE_PRO_MODEL temUnit ON temUnit.ID = temStation.PID\n" +
                "INNER JOIN \n" +
                "    TE_PRO_MODEL temRegion ON temRegion.ID = temUnit.PID\n" +
                "WHERE \n" +
                "    TE_RESOURCE.RESOURCE_ALL_IN_ONE_IP =#{httpUrl}")
        IpVo getLoginIp(@Param("httpUrl") String httpUrl);


}
